<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAiRecordTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ai_record', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("user_id")->default(0)->comment("系统用户id");
            $table->integer('score')->default(0)->comment("分值");
            $table->integer('img_id')->default(0)->comment("图片id");
            $table->string("feel")->nullable()->comment("身体表现");
            $table->text("recomand")->nullable()->comment("调理建议");
            $table->string("typeName")->nullable()->comment("体质类型");
            $table->string("filepath")->nullable()->comment("原图片地址");
            $table->float("typeConfidence")->nullable()->default(0)->comment("体质置信度");
            $table->string("shemianName")->nullable()->comment("舌面类型");
            $table->string("shemianDesc")->nullable()->comment("舌面描述");
            $table->float("shemianConfidence")->nullable()->default(0)->comment("舌面置信度");
            $table->string("shexinName")->nullable()->comment("舌型类型");
            $table->string("shexinDesc")->nullable()->comment("舌型描述");
            $table->float("shexinConfidence")->nullable()->default(0)->comment("舌形置信度");
            $table->string("taiseName")->nullable()->comment("苔色类型");
            $table->string("taiseDesc")->nullable()->comment("苔色描述");
            $table->float("taiseConfidence")->nullable()->default(0)->comment("苔色置信度");
            $table->string("taizhiName")->nullable()->comment("苔质类型");
            $table->string("taizhiDesc")->nullable()->comment("苔质描述");
            $table->float("taizhiConfidence")->nullable()->default(0)->comment("苔质置信度");
            $table->timestamp("createTime")->nullable()->comment("创建时间");
            $table->integer("uid")->default(0)->comment("用户id");
            $table->float("xleftBottom")->default(0);
            $table->float("yleftBottom")->default(0);
            $table->float("xrightTop")->default(0);
            $table->float("yrightTop")->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ai_record');
    }
}
